﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;

namespace Icedream.InstantFileTransfer
{
    public class ConnectionInitializedException : Exception { }
    public class ConnectionUninitializedException : Exception { }
    public class NoConnectionException : SocketException { }
    public class InvalidPortRangeException : Exception { }
    public class InvalidFilenameException : FormatException { }
    public class InvalidFilesizeException : FormatException { }
    public class FileRequestFailedException : NotAcknowledgedException {
        private string reason;

        public FileRequestFailedException(string reason)
        {
            this.reason = reason;
        }
    }
    public class DataMissingException : Exception { }
    public class FileInfoRequestMissingException : RequestMissingException { }
    //public class FileInfoMissingException : DataMissingException { }
    public class FileRequestMissingException : RequestMissingException { }
    public class RequestMissingException : DataMissingException { }
    public class MissingCompressionPluginException : Exception { }
    public class ConnectionFailedException : SocketException
    {
        private string reason;

        public ConnectionFailedException(string reason)
        {
            this.reason = reason;
        }

        public string Reason
        { get { return reason; } }
    }
    public class NotAcknowledgedException : Exception {
        string reason;

        public string Reason { get { return this.reason; } }

        public NotAcknowledgedException()
        {
            reason = "";
        }

        public NotAcknowledgedException(string reason)
        {
            this.reason = reason;
        }
    }
}
